package com.chenfei.sharding.jdbc.service.impl;

import com.chenfei.sharding.jdbc.entity.Student;
import com.chenfei.sharding.jdbc.mapper.StudentMapper;
import com.chenfei.sharding.jdbc.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @author chenfei
 * @description
 * @since 2018/3/30
 */
@Service
public class StudentServiceImpl implements StudentService{

    @Autowired
    StudentMapper studentMapper;

    @Override
    public int insert(Student student) {
        return studentMapper.insertSelective(student);
    }

    @Override
    public Student find(Integer id) {
        return studentMapper.selectByPrimaryKey(id);
    }
}
